package com.example.colorfullbuttons

import android.graphics.Color
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        val colors = listOf(
                Color.BLUE,
                Color.RED,
                Color.CYAN,
                Color.YELLOW,
                Color.GREEN)
        button.setOnClickListener {
            it.setBackgroundColor(colors.random())
        }
    }
}